Winograd algorithm on a matrix processing architecture

ABSTRACT

In one embodiment, a matrix operation may be performed, wherein the matrix operation comprises a matrix multiplication operation on a plurality of matrix operands. Matrix data may be received from a multi-dimensional memory, wherein the matrix data is associated with the plurality of matrix operands. The plurality of matrix operands may be extracted from the matrix data, wherein the plurality of matrix operands comprises a first matrix operand and a second matrix operand. A first transform may be performed on the first matrix operand to obtain a transformed matrix operand, wherein performing matrix multiplication using the transformed matrix operand is faster than performing matrix multiplication using the first matrix operand. Matrix multiplication may be performed on the transformed matrix operand to obtain a partial result. A second transform may be performed on the partial result to obtain a result of the matrix multiplication operation.

FIELD OF THE SPECIFICATION

This disclosure relates in general to the field of computer processing,and more particularly, though not exclusively, to matrix processingsystems.

BACKGROUND

Matrix operations, such as matrix multiplication and convolutions, canbe highly processor-intensive and memory-intensive operations, as theyoften involve complex operations on large, multi-dimensional matrixoperands. Accordingly, the performance of complex matrix operations canbe limited by processing and/or memory latency, and by the efficiency ofalgorithms used to implement the matrix operations. As matrix operationsare increasingly utilized in a variety of applications and withever-growing data sets (from graphics and image processing to machinelearning and artificial intelligence), the demand for high-performanceprocessing of matrix operations is increasing.

BRIEF DESCRIPTION OF THE DRAWINGS

The present disclosure is best understood from the following detaileddescription when read with the accompanying figures. It is emphasizedthat, in accordance with the standard practice in the industry, variousfeatures are not necessarily drawn to scale, and are used forillustration purposes only. Where a scale is shown, explicitly orimplicitly, it provides only one illustrative example. In otherembodiments, the dimensions of the various features may be arbitrarilyincreased or reduced for clarity of discussion.

FIG. 1 illustrates a schematic diagram for an example computing systemaccording to certain embodiments.

FIGS. 2A-C illustrate block diagrams for an example embodiment of amatrix processing architecture.

FIGS. 3 and 4 illustrate block diagrams for example embodiments ofcomputer processors.

FIG. 5 illustrates an example embodiment of a matrix processing engine.

FIGS. 6A and 6B illustrate example Winograd transforms performed by amatrix processing engine.

FIG. 7 illustrates a flowchart for an example embodiment of matrixmultiplication using the Winograd algorithm.

EMBODIMENTS OF THE DISCLOSURE

The following disclosure provides many different embodiments, orexamples, for implementing different features of the present disclosure.Specific examples of components and arrangements are described below tosimplify the present disclosure. These are, of course, merely examplesand are not intended to be limiting. Further, the present disclosure mayrepeat reference numerals and/or letters in the various examples. Thisrepetition is for the purpose of simplicity and clarity and does not initself dictate a relationship between the various embodiments and/orconfigurations discussed. Different embodiments may have differentadvantages, and no particular advantage is necessarily required of anyembodiment.

Matrix processing operations (e.g., linear algebra operations thatinvolve matrix and/or vector operands) have a wide range of applicationsin computing systems, from graphics processing to machine learning andartificial intelligence, among other examples. For example, complexmatrix operations may be used to implement artificial neural networksthat provide artificial intelligence and machine learning capabilities,including computer vision, autonomous navigation, speech and audiorecognition, and natural language processing, among other examples.These complex matrix operations (e.g., matrix multiplication andconvolutions) may be used to implement the fundamental operations ofneural networks, such as forward propagation, backward propagation, andweight updates. These matrix operations, however, can be highlyprocessor and memory intensive, as they often involve complex operationson large, multi-dimensional matrix operands. Accordingly, theperformance of these matrix operations can be limited by processingand/or memory latency. Moreover, these rigid matrix operations are oftenimplemented without any flexibility to implement new types or variationsof matrix operations and/or modify the behavior of existing operations.As matrix operations are increasingly utilized in a variety ofapplications with ever-growing data sets, such as artificialintelligence and machine learning, the demand for both high-performanceprocessing and flexible implementations of matrix operations isincreasing.

Existing matrix processing approaches suffer from variousinefficiencies, particularly when used to implement artificialintelligence and machine learning in artificial neural networks. Forexample, while central processing units (CPUs) could be used to performmatrix operations, many CPU architectures are designed for lowarithmetic intensity operations (i.e., a low ratio of arithmeticoperations relative to memory operations), and thus are not designed forefficient execution of matrix operations. Moreover, many CPUarchitectures utilize complex local or cache memory management routines,which may increase processing overhead and execution complexity foroperations involving large matrix operands. Graphics processing units(GPUs) could also be used to perform matrix operations. GPUs, however,are often designed for high precision computations and may provide alevel of precision that is unnecessary for certain matrix operations,thus reducing the volume of matrix operations that can be performed.Accordingly, existing matrix processing approaches are inefficient forcertain matrix operations, such as matrix multiplication or convolutionoperations involving large matrix operands and/or matrix operands withcertain dimensions, among other examples. Moreover, existing approachescannot be efficiently scaled to perform these matrix operations acrossadditional processing resources in parallel. Thus, existing approachesdo not achieve 100% processing efficiency when scaling and/ordistributing these matrix operations. Moreover, existing approaches areoften rigid and inflexible with limited or no ability to define newmatrix operations, modify existing matrix operations, and so forth.

The matrix processing architecture described throughout this disclosurecan perform matrix multiplication operations using an implementation ofthe Winograd matrix multiplication algorithm. Winograd is an algorithmthat accelerates matrix multiplication by transforming the operands ofthe matrix multiplication operation into new “Winograd” operands that,when multiplied, require fewer overall multiplications by replacing someof the multiplications with addition and subtraction. The result of themultiplication on the Winograd operands, however, must then betransformed to obtain the final result of the original matrixmultiplication operation. Winograd is particularly beneficial for smallfilter sizes and is superior to other transform techniques for thosesmall filter sizes, such as Fast Fourier Transform.

The performance improvement provided by the Winograd algorithm dependson the size of the output tile. For example, a Winograd algorithm can beimplemented to output either a 2×2 output tile, or a 4×4 output tile. AWinograd algorithm that outputs a 2×2 output tile can be referred to asWinograd 2, while a Winograd algorithm that outputs a 4×4 output tilecan be referred to as Winograd 4. For Winograd 2 (e.g., using a 2×2output tile), the Winograd transform converts the 3×3 filter into a 4×4filter with a stride of 2. The performance improvement provided byWinograd 2 using the 2×2 output tile is 2.25. For Winograd 4 (e.g.,using a 4×4 output tile), the Winograd transform converts the 3×3 filterinto a 6×6 filter with a stride of 4. The performance improvementprovided by Winograd 4 using the 4×4 output tile is 4. Accordingly,assuming the Winograd transforms are implemented efficiently, using theWinograd algorithm for a convolution operation can reduce the processingtime of a normal convolution by approximately one-half to one-fourth(depending on whether Winograd 2 or Winograd 4 is used). The matrixprocessing architecture described throughout this disclosure can be usedto efficiently implement the Winograd algorithm in a manner thatachieves a greater performance improvement than is possible using CPUsor GPUs.

Example embodiments that may be used to implement the matrix processingfunctionality of this disclosure will now be described with moreparticular reference to the attached FIGURES.

FIG. 1 illustrates a schematic diagram for an example computing system100 according to certain embodiments.

In some embodiments, the matrix processing functionality describedthroughout this disclosure may be implemented in system 100. Matrixprocessing functionality may be used in system 100 for a wide range ofapplications and/or use cases involving matrix operations, from graphicsprocessing to machine learning and artificial intelligence, among otherexamples. For example, in some embodiments, matrix processingfunctionality may be used to implement artificial intelligence andmachine learning in artificial neural networks. Moreover, matrixprocessing functionality may be implemented by any component of system100. For example, in the illustrated embodiment, system 100 includesedge devices 110, cloud services 120, matrix processing nodes 130, andnetwork 150. Matrix processing nodes 130 may include any component ordevice with matrix processing functionality, including any component ofsystem 100. For example, matrix processing nodes 130 may include cloudservices 120 and/or servers implemented with matrix processingfunctionality (e.g., application servers in a datacenter), edge devices110 implemented with matrix processing functionality (e.g., end-userdevices 112, Internet-of-Things devices 114, gateways 116), and soforth. These various components of system 100 are discussed furtherbelow.

Edge devices 110 may include any equipment and/or devices deployed orconnected near the “edge” of a communication system 100. Edge devices110 may communicate with each other and/or with other remote networksand services (e.g., cloud services 120) through one or more networksand/or communication protocols, such as network 150. In someembodiments, certain edge devices 110 may include the matrix processingfunctionality described throughout this disclosure, and thus may be usedas matrix processing nodes 130. In the illustrated embodiment, edgedevices 110 include end-user devices 112 (e.g., desktops, laptops,mobile devices), Internet-of-Things (IoT) devices 114, and gatewaysand/or routers 116, among other examples.

End-user devices 112 may include any device that enables or facilitatesuser interaction with computing system 100, including, for example,desktop computers, laptops, tablets, mobile phones and other mobiledevices, and wearable devices (e.g., smart watches, smart glasses,headsets), among other examples.

IoT devices 114 may include any device capable of communicating and/orparticipating in an Internet-of-Things (IoT) system or network. IoTsystems may refer to new or improved ad-hoc systems and networkscomposed of multiple different devices (e.g., IoT devices 114)interoperating and synergizing for a particular application or use case.Such ad-hoc systems are emerging as more and more products and equipmentevolve to become “smart,” meaning they are controlled or monitored bycomputer processors and are capable of communicating with other devices.For example, an IoT device 114 may include a computer processor and/orcommunication interface to allow interoperation with other components ofsystem 100, such as with cloud services 120 and/or other edge devices110. IoT devices 114 may be “greenfield” devices that are developed withIoT capabilities from the ground-up, or “brownfield” devices that arecreated by integrating IoT capabilities into existing legacy devicesthat were initially developed without IoT capabilities. For example, insome cases, IoT devices 114 may be built from sensors and communicationmodules integrated in or attached to “things,” such as equipment, toys,tools, vehicles, living things (e.g., plants, animals, humans), and soforth. Alternatively, or additionally, certain IoT devices 114 may relyon intermediary components, such as edge gateways or routers 116, tocommunicate with the various components of system 100.

IoT devices 114 may include various types of sensors for monitoring,detecting, measuring, and generating sensor data and signals associatedwith characteristics of their environment. For instance, a given sensormay be configured to detect one or more respective characteristics, suchas movement, weight, physical contact, temperature, wind, noise, light,position, humidity, radiation, liquid, specific chemical compounds,battery life, wireless signals, computer communications, and bandwidth,among other examples. Sensors can include physical sensors (e.g.,physical monitoring components) and virtual sensors (e.g.,software-based monitoring components). IoT devices 114 may also includeactuators to perform various actions in their respective environments.For example, an actuator may be used to selectively activate certainfunctionality, such as toggling the power or operation of a securitysystem (e.g., alarm, camera, locks) or household appliance (e.g., audiosystem, lighting, HVAC appliances, garage doors), among other examples.

Indeed, this disclosure contemplates use of a potentially limitlessuniverse of IoT devices 114 and associated sensors/actuators. IoTdevices 114 may include, for example, any type of equipment and/ordevices associated with any type of system 100 and/or industry,including transportation (e.g., automobile, airlines), industrialmanufacturing, energy (e.g., power plants), telecommunications (e.g.,Internet, cellular, and television service providers), medical (e.g.,healthcare, pharmaceutical), food processing, and/or retail industries,among others. In the transportation industry, for example, IoT devices114 may include equipment and devices associated with aircrafts,automobiles, or vessels, such as navigation systems, autonomous flightor driving systems, traffic sensors and controllers, and/or any internalmechanical or electrical components that are monitored by sensors (e.g.,engines). IoT devices 114 may also include equipment, devices, and/orinfrastructure associated with industrial manufacturing and production,shipping (e.g., cargo tracking), communications networks (e.g.,gateways, routers, servers, cellular towers), server farms, electricalpower plants, wind farms, oil and gas pipelines, water treatment anddistribution, wastewater collection and treatment, and weathermonitoring (e.g., temperature, wind, and humidity sensors), among otherexamples. IoT devices 114 may also include, for example, any type of“smart” device or system, such as smart entertainment systems (e.g.,televisions, audio systems, videogame systems), smart household oroffice appliances (e.g., heat-ventilation-air-conditioning (HVAC)appliances, refrigerators, washers and dryers, coffee brewers), powercontrol systems (e.g., automatic electricity, light, and HVAC controls),security systems (e.g., alarms, locks, cameras, motion detectors,fingerprint scanners, facial recognition systems), and other homeautomation systems, among other examples. IoT devices 114 can bestatically located, such as mounted on a building, wall, floor, ground,lamppost, sign, water tower, or any other fixed or static structure. IoTdevices 114 can also be mobile, such as devices in vehicles oraircrafts, drones, packages (e.g., for tracking cargo), mobile devices,and wearable devices, among other examples. Moreover, an IoT device 114can also be any type of edge device 110, including end-user devices 112and edge gateways and routers 116.

Edge gateways and/or routers 116 may be used to facilitate communicationto and from edge devices 110. For example, gateways 116 may providecommunication capabilities to existing legacy devices that wereinitially developed without any such capabilities (e.g., “brownfield”IoT devices). Gateways 116 can also be utilized to extend thegeographical reach of edge devices 110 with short-range, proprietary, orotherwise limited communication capabilities, such as IoT devices 114with Bluetooth or ZigBee communication capabilities. For example,gateways 116 can serve as intermediaries between IoT devices 114 andremote networks or services, by providing a front-haul to the IoTdevices 114 using their native communication capabilities (e.g.,Bluetooth, ZigBee), and providing a back-haul to other networks 150and/or cloud services 120 using another wired or wireless communicationmedium (e.g., Ethernet, Wi-Fi, cellular). In some embodiments, a gateway116 may be implemented by a dedicated gateway device, or by a generalpurpose device, such as another IoT device 114, end-user device 112, orother type of edge device 110.

In some instances, gateways 116 may also implement certain networkmanagement and/or application functionality (e.g., IoT management and/orIoT application functionality for IoT devices 114), either separately orin conjunction with other components, such as cloud services 120 and/orother edge devices 110. For example, in some embodiments, configurationparameters and/or application logic may be pushed or pulled to or from agateway device 116, allowing IoT devices 114 (or other edge devices 110)within range or proximity of the gateway 116 to be configured for aparticular IoT application or use case.

Cloud services 120 may include services that are hosted remotely over anetwork 150, or in the “cloud.” In some embodiments, for example, cloudservices 120 may be remotely hosted on servers in datacenter (e.g.,application servers or database servers). Cloud services 120 may includeany services that can be utilized by or for edge devices 110, includingbut not limited to, data storage, computational services (e.g., dataanalytics, searching, diagnostics and fault management), securityservices (e.g., surveillance, alarms, user authentication), mapping andnavigation, geolocation services, network or infrastructure management,IoT application and management services, payment processing, audio andvideo streaming, messaging, social networking, news, and weather, amongother examples. In some embodiments, certain cloud services 120 mayinclude the matrix processing functionality described throughout thisdisclosure, and thus may be used as matrix processing nodes 130.

In general, edge devices 110 (and in particular IoT devices 114) maygenerate an extremely large volume and variety of data. IoT edge devices114 typically offload this data to the cloud for processing and/orstorage (e.g., by cloud services 120). Cloud services 120, however, maynot necessarily be suited to handle the rapidly growing volume, variety,and velocity of data generated by IoT devices 114 and other edge devices110. For example, cloud-based processing may not be ideal in certaincircumstances, such as processing time-sensitive or highly confidentialdata, or when faced with network bandwidth constraints, among otherexamples. In some embodiments, cloud services 120 may leverage “edge”based processing using edge devices 110 to improve the performance ofcloud services. Edge processing is an approach that involves processingcertain data at the network edge (e.g., using edge devices 110), nearwhere the data is generated, rather than simply funneling large volumesof data to the cloud for processing and storage. Certain data may stillbe sent to the cloud, as appropriate, such as for deeper analysis and/orlong-term storage. Edge processing may be used to complement theshortcomings of cloud-based processing (e.g., when cloud-basedprocessing is inefficient, ineffective, and/or unsecure), and thusimprove the handling of the growing volume, variety, and velocity ofdata generated by IoT devices 114 and/or other edge devices 110. Forexample, in some cases, processing data near its source (e.g., in thenetwork edge) rather than in the cloud may improve performance and/oravoid system failures or disasters. Edge processing may also conservenetwork bandwidth, which may be particularly beneficial when facingbandwidth constraints and/or limited network connectivity.

In some embodiments, edge devices 110 that provide edge-based processingfor cloud services 120 may be collectively referred to as the “fog,” asthey serve to extend the “cloud” to the edge of the network, thuscreating a “fog” over the network edge. In some embodiments, devices 110in the “fog” may connect and/or communicate with each other, forexample, using an interconnection standard or protocol. For example, insome embodiments, device interconnection may be implemented using theopen interconnect consortium (OIC) standard specification 1.0, releasedby the Open Connectivity Foundation™ (OCF) on Dec. 23, 2015, whichenables devices to discover and connect with each other. Anotherinterconnection protocol that may be used is Thread, a networkingprotocol for Internet-of-Things (IoT) devices used in “smart” homeautomation and similar deployments, which has been developed by analliance of organizations named the “Thread Group.” Otherinterconnection protocols may also be used, including, for example, theoptimized link state routing (OLSR) protocol, or the better approach tomobile ad-hoc networking (B.A.T.M.A.N.), among others.

Network 150 may be used to facilitate communication between thecomponents of computing system 100. For example, edge devices 110, suchas end-user devices 112 and IoT devices 114, may use network 150 tocommunicate with each other and/or access one or more remote cloudservices 120. Network 150 may include any number or type ofcommunication networks, including, for example, local area networks,wide area networks, public networks, the Internet, cellular networks,Wi-Fi networks, short-range networks (e.g., Bluetooth or ZigBee), and/orany other wired or wireless networks or communication mediums.

Any, all, or some of the computing devices of system 100 may be adaptedto execute any operating system, including Linux or other UNIX-basedoperating systems, Microsoft Windows, Windows Server, MacOS, Apple iOS,Google Android, or any customized and/or proprietary operating system,along with virtual machines adapted to virtualize execution of aparticular operating system.

While FIG. 1 is described as containing or being associated with aplurality of elements, not all elements illustrated within system 100 ofFIG. 1 may be utilized in each alternative implementation of the presentdisclosure. Additionally, one or more of the elements described inconnection with the examples of FIG. 1 may be located external to system100, while in other instances, certain elements may be included withinor as a portion of one or more of the other described elements, as wellas other elements not described in the illustrated implementation.Further, certain elements illustrated in FIG. 1 may be combined withother components, as well as used for alternative or additional purposesin addition to those purposes described herein.

Example Matrix Processing Architecture

FIGS. 2A-C illustrate block diagrams for an example embodiment of amatrix processing architecture.

In some embodiments, the matrix processing functionality describedthroughout this disclosure may be implemented using a matrix processingarchitecture, such as the matrix processing architecture of FIGS. 2A-2C.Matrix processing architectures, such as the matrix processingarchitecture of FIGS. 2A-2C, may be implemented or used in a variety ofsystems, devices, and/or components, such as those described throughoutthis disclosure, including system 100 of FIG. 1 and/or any of itsassociated components (e.g., cloud services 120/datacenter servers, edgedevices 110, matrix processing nodes 130). In some embodiments, thematrix processing architecture of FIGS. 2A-2C may be used to implementartificial intelligence and machine learning in neural networks. Thematrix processing architecture illustrated in FIGS. 2A-2C is merely oneexample embodiment for performing the matrix processing functionalitydescribed throughout this disclosure. Other embodiments may usedifferent types, arrangements, and/or numbers of components. Forexample, other embodiments may include any number of matrix processingchips 220, matrix processing clusters 230, matrix processing units(MPUs) 234, high bandwidth memory (HBM) modules 240, and/or memoryresource blocks (MRBs) 238. Moreover, all or part of any component ofthe matrix processing architecture of FIGS. 2A-2C (e.g., any componentof matrix processing system 200, matrix processing chips 220, and/ormatrix processing clusters 230) may be implemented as a separate orstand-alone component or chip, or may be integrated with othercomponents or chips, such as a system-on-a-chip (SoC) that integratesvarious computer components into a single chip.

FIG. 2A illustrates a block diagram for an example embodiment of amatrix processing system 200. In the illustrated embodiment, matrixprocessing system 200 includes host processor 260, host memory 270,matrix processing resources 210, and interconnect bus 280.

Host processor 260 may be configured to control and/or manage matrixprocessing system 200. For example, in some embodiments, host processor260 may use matrix processing resources 210 to perform complex matrixoperations. Host processor 260 may be any processing resource capable ofcontrolling and/or managing matrix processing functionality of matrixprocessing system 200. For example, in some embodiments, host processor260 may be implemented using computer processors 300 or 400 of FIGS. 3and 4, respectively. In some embodiments, host processor 260 may be aseparate or stand-alone component that is communicatively coupled tomatrix processing resources 210. Alternatively, in other embodiments,host processor 260 and matrix processing resources 210 may be integratedinto the same component or chip. For example, in some embodiments, thecomponents of matrix processing system 200, including host processor 260and matrix processing resources 210, may be implemented as asystem-on-a-chip (SoC).

Host memory 270 may include any type or combination of volatile and/ornon-volatile memory. Examples of volatile memory include various typesof random access memory (RAM), such as dynamic random access memory(DRAM), synchronous dynamic random access memory (SDRAM), and staticrandom access memory (SRAM), among other examples. Examples ofnon-volatile memory include disk-based storage mediums (e.g., magneticand/or optical storage mediums), solid-state storage (e.g., any form ofpersistent flash memory, including planar or three dimensional (3D) NANDflash memory or NOR flash memory), 3D crosspoint memory, electricallyerasable programmable read-only memory (EEPROM), and/or other types ofnon-volatile random access memories (RAM), among other examples. Hostmemory 270 may be used, for example, to store information for hostprocessor 260 during execution, such as code and/or data.

Interconnect bus 280 may be used, in some embodiments, tocommunicatively couple host processor 260 and host memory 270 to matrixprocessing resources 210. Interconnect bus 280 may use anyinterconnection protocol, such as Peripheral Component Interconnectexpress (PCIe), Universal Serial Bus (USB), or Small Computer SystemsInterface (SCSI), among other examples.

Matrix processing resources 210 may include any processing resourcesconfigured to perform matrix operations. For example, matrix processingresources 210 may be configured to perform matrix multiplicationoperations, convolution operations, element-wise matrix operations(e.g., +, *, / <, >, ==), dimension shuffle operations, and/or anycombination thereof. In some embodiments, matrix processing resources210 may include processing resources that are designed and optimized forperforming matrix operations. In some embodiments, matrix processingresources 210 may also be arranged hierarchically with multiple levelsof processing resources. For example, in the illustrated embodiment,matrix processing resources 210 include a plurality of matrix processingchips 220, and may also include any processing resources within eachmatrix processing chip 220. For example, as discussed below inconnection with FIGS. 2B and 2C, each matrix processing chip 220 mayinclude a plurality of high bandwidth memory (HBM) modules 240 and aplurality of matrix processing clusters 230, and each matrix processingcluster 230 may include multiple matrix processing units 234. Thus, insome embodiments, matrix processing resources 210 may include multiplematrix processing chips 220, multiple high bandwidth memory (HBM)modules 240 and multiple matrix processing clusters 230 on each matrixprocessing chip 220, and/or multiple matrix processing units 234 on eachmatrix processing cluster 230.

Matrix processing chips 220 may be, for example, any chips or othercomponents configured to perform matrix operations. For example, in someembodiments, a matrix processing chip 220 may be a peripheral card orchip connected to host processor 260 using any type of interconnectinterface, such as a PCIe interface. In some embodiments, a matrixprocessing chip 220 may be implemented using an integrated circuit, suchas an application specific integrated circuit (ASIC), a fieldprogrammable gate array (FPGA), and/or any other type of circuitry. Inthe illustrated embodiment, matrix processing chips 220 are configuredin a cyclical arrangement, with communication channels 215 betweenneighboring matrix processing chips 220. In some embodiments,communication channels 215 may provide one-way communication betweenneighboring matrix processing chips 220. In other embodiments, however,communication channels 215 may provide bi-directional communicationbetween neighboring matrix processing chips 220. A cyclical arrangementwith one-way communication between neighboring processing resources maybe referred to as a “single-cyclical” configuration, while a cyclicalarrangement with bi-directional communication between neighboringprocessing resources may be referred to as a “dual-cyclical”configuration.

Moreover, although not illustrated, in some embodiments matrixprocessing system 200 may include a communication interface tocommunicate over a communication network. For example, in someembodiments, matrix processing system 200 may communicate over a networkwith one or more remote matrix processing chips to perform distributedmatrix operations.

FIG. 2B illustrates a block diagram for an example embodiment of amatrix processing chip 220. In the illustrated embodiment, matrixprocessing chip 220 includes controller 222, host interface 224,inter-chip links 225, high bandwidth memory (HBM) modules 240, andmatrix processing clusters 230.

Controller 222 may be configured to control and/or manage matrixoperations performed by matrix processing chip 220. In some embodiments,controller 222 may control and/or manage matrix operations inconjunction with host processor 260 of FIG. 2A and/or master controlCPUs (MCCs) 232 of matrix processing clusters 230 of FIG. 2C. Forexample, in some embodiments, host processor 260, controller 222, and/ormaster control CPUs (MCCs) 232 may be configured to receive a matrixoperation or command, and distribute the matrix operation and matrixoperands across matrix processing clusters 230 and high bandwidth memory(HBM) modules 240. In some embodiments, controller 222 may be amicroprocessor, an integrated circuit, and/or any other type ofcircuitry and/or processing logic.

Host interface 224 may be a communication interface that enables amatrix processing chip 220 to communicate with host processor 260 ofFIG. 2A. In some embodiments, for example, controller 222 may use hostinterface 224 to communicate with host processor 260 of FIG. 2A. Hostinterface 224 may use any type of interconnect protocol or interface,including Peripheral Component Interconnect express (PCIe), UniversalSerial Bus (USB), or Small Computer Systems Interface (SCSI), amongother examples.

Inter-chip links (ICLs) 225 may enable a matrix processing chip 220 tocommunicate with other matrix processing chips. For example, inter-chiplinks 225 may be used to implement the communication channels 215between matrix processing chips 220 in FIG. 2A. An inter-chip link 225may be, for example, any communication interface that enables a matrixprocessing chip 220 to communicate with another matrix processing chip.In some embodiments, a matrix processing chip 220 may include multipleinter-chip links 225 (e.g., twelve inter-chip links). In someembodiments, an inter-chip link 225 may be implemented using one or moreserializer/de-serializer (SerDes) interfaces. A SerDes interface may bea communication interface that converts data from serial to parallel,and vice-versa. For example, the transmitter of a SerDes interface mayinclude a serial-to-parallel converter, and the receiver of a SerDesinterface may include a parallel-to-serial converter. In someembodiments, a matrix processing chip 220 may use multiple SerDesinterfaces for each connection to another matrix processing chip (e.g.,four SerDes interfaces between each pair of connected matrix processingchips).

High bandwidth memory (HBM) modules 240 may be memory componentsassociated with matrix processing chip 220 that are used to store matrixoperands and other matrix data. In some embodiments, high bandwidthmemory (HBM) modules 240 may be designed to efficiently store andretrieve matrix data. In some embodiments, high bandwidth memory (HBM)modules 240 may be multi-dimensional memory components configured tostore and retrieve data in multiple dimensions. For example, in someembodiments, high bandwidth memory (HBM) modules 240 may be memorycomponents configured to store and retrieve data in two dimensions, suchas rows and columns. Other embodiments, however, may use memorycomponents configured to store and retrieve data using any other numberof dimensions (e.g., one dimension, three dimensions, four dimensions,and so forth). In the illustrated embodiment, matrix processing chip 220includes four high bandwidth memory (HBM) modules 240 a-d. In someembodiments, high bandwidth memory (HBM) modules 240 may be shared bythe matrix processing clusters 230 of a matrix processing chip 220.

Matrix processing clusters 230 may include processing resourcesconfigured to perform matrix operations, such as matrix multiplication,convolutions, and/or dimension shuffling, among other examples. In someembodiments, matrix processing clusters 230 may be collectively used toexecute a particular matrix operation by performing matrix processing inparallel. In the illustrated embodiment, matrix processing chip 220includes twelve matrix processing clusters 230 a-l. Moreover, in theillustrated embodiment, matrix processing clusters 230 are configured orarranged using a two-dimensional mesh interconnection topology. Theinterconnection topology of matrix processing clusters 230 mayfacilitate cyclical communication among the matrix processing clusters230. Moreover, other embodiments may include any number and/orarrangement of matrix processing clusters 230.

FIG. 2C illustrates a block diagram for an example embodiment of amatrix processing cluster 230. In the illustrated embodiment, matrixprocessing cluster 230 includes master control CPU (MCC) 232, matrixprocessing units (MPUs) 234, slicing engine 236, and memory resourceblocks (MRBs) 238.

Master control CPU (MCC) 232 may be configured to control and/or managematrix operations performed by a matrix processing cluster 230. In someembodiments, master control CPU 232 may be a microprocessor, anintegrated circuit, and/or any other type of circuitry and/or processinglogic. In some embodiments, master control CPU 232 may receiveinstructions from another component, such as host processor 260 of FIG.2A and/or controller 222 of FIG. 2B. Based on the instructions, mastercontrol CPU 232 may then use matrix processing units 234 to performmatrix operations, such as matrix multiplication, convolutions, and/ordimension shuffling, among other examples. For example, master controlCPU 232 may receive an instruction to perform a matrix multiplicationoperation, such as C=A*B. The instruction may include the handles oridentifiers for each matrix, and may also indicate how the matricesshould be stored in memory resource blocks (MRBs) 238. Matrices A and Bmay then be broken down into a series of smaller matrices (e.g., 32×32matrices). Matrix operations may then be performed on the smallermatrices, and the partial results may be stored in memory resourceblocks (MRBs) 238, until the output matrix C has been fully computed.

Matrix processing units (MPUs) 234 may be configured to perform matrixoperations, such as matrix multiplication, convolutions, and/ordimension shuffling. In some embodiments, matrix processing units (MPUs)234 perform matrix operations based on commands received from mastercontrol CPU (MCC) 232. Moreover, in some embodiments, each matrixprocessing cluster 230 may include multiple matrix processing units(MPUs) 234. For example, in the illustrated embodiment, matrixprocessing cluster 230 includes two matrix processing units (MPUs) 234.A matrix processing unit (MPU) 234 may be capable of performing matrixoperations, such as matrix multiplication, on small matrices (e.g.,32×32 matrices). In some cases, a matrix processing unit (MPU) 234 maybe designed and/or optimized to perform matrix multiplicationoperations. A matrix processing unit (MPU) 234 may load matrix operandsfrom memory resource blocks (MRBs) 238. In some embodiments, a matrixprocessing unit (MPU) 234 may support the following arithmeticoperations: matrix multiplication; unary matrix operations; binarymatrix operations, such as addition (+), subtraction (−), multiplication(*), division (/), bitwise XOR, AND, OR, logical and arithmetic left andright shift, comparison (>, <, >=, <=, ==, !=); and column-wise,row-wise, and matrix-wide operations, such as sum, max value, and minvalue.

Slicing engine 236 may be configured to slice the matrix operands of aparticular matrix operation into smaller partial matrices. For example,in some embodiments, master control CPU (MCC) 232 may use slicing engine236 to break up matrix operands into smaller partial matrices for matrixprocessing units (MPUs) 234. In some embodiments, slicing engine 236 mayinclude a convolution slicing engine (CSE) to perform matrix slicing forconvolution operations. For example, in some embodiments, a convolutionslicing engine (CSE) may slice matrix operands in a manner that enablesa convolution operation to be cast as a matrix multiplication operation,thus enabling the same processing logic to perform both matrixmultiplication and convolution operations. Moreover, in someembodiments, slicing engine 236 and/or the associated convolutionslicing engine (CSE) may be used to perform the dimension shuffleoperations to reorder the dimensions of a matrix.

Memory resource blocks (MRBs) 238 may be memory components on matrixprocessing cluster 230 used to store matrix operands and other matrixdata. In some embodiments, memory resource blocks (MRBs) 238 may bedesigned to store and retrieve matrix data efficiently. In someembodiments, memory resource blocks (MRBs) 238 may be multi-dimensionalmemory components configured to store and retrieve data in multipledimensions. For example, in some embodiments, memory resource blocks(MRBs) 238 may be memory components configured to store and retrievedata in two dimensions, such as rows and columns. In the illustratedembodiment, matrix processing cluster 230 includes ten memory resourceblocks (MRBs) 238. Other embodiments, however, may include a differentnumber of memory resource blocks (MRBs) 238 on a matrix processingcluster 230. In some embodiments, each memory resource block (MRB) 238may be capable of storing a matrix of a certain size (e.g., a 256×512matrix). In some embodiments, memory resource blocks (MRBs) 238 may beshared by the matrix processing units (MPUs) 234 of a particular matrixprocessing cluster 230.

In some embodiments, the matrix processing architecture of FIGS. 2A-2Cmay be used to implement the matrix processing functionality describedthroughout this disclosure. For example, matrix processing system 200may be used to perform matrix operations using a distributed approachthat achieves 100% processing efficiency using the available processingresources. For example, in some embodiments, a matrix operation may bedistributed across multiple processing resources 210 that are optimizedfor matrix processing, thus enabling full utilization of the processingresources 210 throughout the duration of the matrix operation. Forexample, matrix processing system 200 may include multiple processingresources 210 that are designed and optimized for performing matrixoperations. In some embodiments, these processing resources 210 may beconfigured in a single-cyclical or dual-cyclical arrangement. Inaddition, the processing resources 210 may be arranged hierarchicallywith multiple levels of processing resources. For example, in someembodiments, the processing resources 210 may include multiple matrixprocessing chips 220, multiple high bandwidth memory (HBM) modules 240and multiple matrix processing clusters 230 on each matrix processingchip 220, and/or multiple matrix processing units (MPUs) 234 on eachmatrix processing cluster 230. This processing architecture enablesmatrix operations to be distributed across multiple processing resources210 and/or processing hierarchies with 100% processing efficiency. Inaddition, this processing architecture enables matrix operations to beefficiently scaled across a variable number of processing resources 210operating in parallel, while still achieving 100% processing efficiency.For example, scaling may be achieved by adjusting the number ofprocessing resources 210 used to perform a particular matrix operation,such as the number of matrix processing systems 200 or servers, thenumber of matrix processing chips 220 in each matrix processing system200 or server, and so forth.

As an example, the matrix processing architecture of FIGS. 2A-2C may beused to implement matrix multiplication and/or convolution operations.For example, in some embodiments, a matrix multiplication operation maybe distributed across multiple processing resources 210 in a manner thatresults in the latency for communicating matrix operands being less thanthe matrix processing time, which allows the communication of matrixoperands to be completed while the matrix processing is being performed.For example, for certain matrix operations involving matrix operandswith certain dimensions (e.g., matrix multiplication with a “thin”matrix operand), the time required to access and communicate matrixoperands may exceed the time required to perform the actual matrixcomputations, resulting in idle processing time while the matrixoperands are being obtained from memory and/or communicated toprocessing resources 210. For example, a single-cyclical configuration(e.g., where each processing resource 210 only obtains matrix operandsand data from one neighboring processing resource 210 at any given time)may be unable to achieve 100% processing efficiency for these particulartypes of matrix operations and matrix operands. However, a dual-cyclicalconfiguration of processing resources 210 enables each processingresource to perform matrix computations while simultaneously obtainingmatrix operands and data from both of its neighboring processingresources 210, which significantly reduces the latency for communicatingmatrix operands, and thus avoids any idle processing time. For example,the communication latency for certain operations may be reduced by halfwhen using a dual-cyclical approach as opposed to a single-cyclicalapproach. In this manner, the latency for communicating matrix operandsand matrix data can be fully masked by the matrix processing time, thusavoiding any wasted or idle processing time and achieving 100%processing efficiency. Accordingly, matrix operations (e.g., matrixmultiplication or GEMM) can be performed efficiently even for largematrix operands and/or matrix operands with certain dimensions, such asa large matrix operand that is neither square nor a single vector (e.g.,a “thin” matrix with a much larger height than width). For example,matrix multiplication can be performed efficiently even when multiplyingtwo thin matrices, a thin matrix and a square matrix, and so forth.Similarly, convolution operations may be distributed across multipleprocessing resources 210 in a manner that results in 100% processingefficiency using the available processing resources.

As an example, when a matrix operation or command is received, thematrix operation may be distributed across the processing resources 210of matrix processing system 200. For example, the matrix operands (orinput matrices) may be partitioned based on the number of availableprocessing resources 210. Moreover, in some embodiments, the partitionsmay be across the rows of the matrix operands, and/or across any otherdimension of the matrix operands. Each partition may then be distributedto a particular processing resource 210. Each processing resource 210may then perform a plurality of partial matrix operations. In someembodiments, the plurality of partial matrix operations is performed ina plurality of stages. For example, each processing resource 210 mayperform a particular stage of partial matrix operations whilesimultaneously sending and receiving partial matrix data to and from itsneighboring processing resources 210. For example, in a single-cyclicalconfiguration of processing resources 210, each processing resource 210either sends or receives partial matrix data to or from each neighborprocessing resource. Similarly, in a dual-cyclical configuration ofprocessing resources 210, each processing resource 210 may send andreceive partial matrix data to and from each neighboring processingresource 210.

Each processing resource 210 may then use the partial matrix data forsubsequent partial matrix operations. The result of the matrix operationmay then be determined based on the partial matrix operationscollectively performed by the processing resources 210.

Moreover, if the processing resources 210 are arranged hierarchically,the matrix operation may be distributed in a hierarchical manner. Forexample, the matrix operands (or input matrices) may initially bepartitioned based on the number of available matrix processing chips220. Each partition, and the associated partial matrix operations, maythen be distributed to a particular matrix processing chip 220. Thepartition and partial matrix operations distributed to a particularmatrix processing chip 220 may then be similarly partitioned anddistributed across the matrix processing clusters 230 and/or highbandwidth memory (HBM) modules 240 of the particular matrix processingchip 220. For example, for certain matrix operations, partial matrixoperations may be distributed to each matrix processing cluster 230.Alternatively, for certain matrix operations, partial matrix operationsmay be distributed across various “logical processing nodes” (e.g.,groups of matrix processing clusters 230 associated with ahigh-bandwidth memory (HBM) module 240), and may then be distributed toeach matrix processing cluster 230 of a particular logical processingnode. In some embodiments, the matrix processing clusters 230 (and/orthe logical processing nodes) may be cyclically configured similar tothe matrix processing chips 220. The partition and partial matrixoperations distributed to a particular matrix processing cluster 230 maythen be similarly partitioned and distributed across the matrixprocessing units (MPUs) 234 of the particular matrix processing cluster230.

Example Computer Processor Architectures

FIGS. 3 and 4 illustrate block diagrams for example embodiments ofcomputer processors that may be used in accordance with embodimentsdisclosed herein. For example, the computer processors illustrated inFIGS. 3 and 4 may be used as host processors associated with matrixprocessing systems (e.g., host processor 260 in matrix processing system200 of FIG. 2A), or as processors associated with other componentsand/or devices discussed throughout this disclosure (e.g., processorsassociated with components in system 100 of FIG. 1). Other processor andsystem designs and configurations known in the art for laptops,desktops, handheld PCs, personal digital assistants, engineeringworkstations, servers, network devices, network hubs, switches, embeddedprocessors, digital signal processors (DSPs), graphics devices, videogame devices, set-top boxes, micro controllers, cell phones, portablemedia players, hand held devices, and various other electronic devices,are also suitable. In general, a huge variety of systems or electronicdevices capable of incorporating a processor and/or other executionlogic as disclosed herein are generally suitable.

FIG. 3 illustrates a block diagram for an example embodiment of aprocessor 300. Processor 300 is an example of a type of hardware devicethat can be used in connection with the embodiments described throughoutthis disclosure. Processor 300 may be any type of processor, such as amicroprocessor, an embedded processor, a digital signal processor (DSP),a network processor, a multi-core processor, a single core processor, orother device to execute code. Although only one processor 300 isillustrated in FIG. 3, a processing element may alternatively includemore than one of processor 300 illustrated in FIG. 3. Processor 300 maybe a single-threaded core or, for at least one embodiment, the processor300 may be multi-threaded in that it may include more than one hardwarethread context (or “logical processor”) per core.

FIG. 3 also illustrates a memory 302 coupled to processor 300 inaccordance with an embodiment. Memory 302 may be any of a wide varietyof memories (including various layers of memory hierarchy) as are knownor otherwise available to those of skill in the art. Such memoryelements can include, but are not limited to, random access memory(RAM), read only memory (ROM), logic blocks of a field programmable gatearray (FPGA), erasable programmable read only memory (EPROM), andelectrically erasable programmable ROM (EEPROM).

Processor 300 can execute any type of instructions associated withalgorithms, processes, or operations detailed herein. Generally,processor 300 can transform an element or an article (e.g., data) fromone state or thing to another state or thing.

Code 304, which may be one or more instructions to be executed byprocessor 300, may be stored in memory 302, or may be stored insoftware, hardware, firmware, or any suitable combination thereof, or inany other internal or external component, device, element, or objectwhere appropriate and based on particular needs. In one example,processor 300 can follow a program sequence of instructions indicated bycode 304. Each instruction enters a front-end logic 306 and is processedby one or more decoders 308. The decoder may generate, as its output, amicro operation such as a fixed width micro operation in a predefinedformat, or may generate other instructions, microinstructions, orcontrol signals that reflect the original code instruction. Front-endlogic 306 may also include register renaming logic and scheduling logic,which generally allocate resources and queue the operation correspondingto the instruction for execution.

Processor 300 can also include execution logic 314 having a set ofexecution units 316 a, 316 b, 316 n, etc. Some embodiments may include anumber of execution units dedicated to specific functions or sets offunctions. Other embodiments may include only one execution unit or oneexecution unit that can perform a particular function. Execution logic314 performs the operations specified by code instructions.

After completion of execution of the operations specified by the codeinstructions, back-end logic 318 can retire the instructions of code304. In one embodiment, processor 300 allows out of order execution butrequires in order retirement of instructions. Retirement logic 320 maytake a variety of known forms (e.g., re-order buffers or the like). Inthis manner, processor 300 is transformed during execution of code 304,at least in terms of the output generated by the decoder, hardwareregisters and tables utilized by register renaming logic 310, and anyregisters (not shown) modified by execution logic 314.

Although not shown in FIG. 3, a processing element may include otherelements on a chip with processor 300. For example, a processing elementmay include memory control logic along with processor 300. Theprocessing element may include I/O control logic and/or may include I/Ocontrol logic integrated with memory control logic. The processingelement may also include one or more caches. In some embodiments,non-volatile memory (such as flash memory or fuses) may also be includedon the chip with processor 300.

FIG. 4 illustrates a block diagram for an example embodiment of amultiprocessor 400. As shown in FIG. 4, multiprocessor system 400 is apoint-to-point interconnect system, and includes a first processor 470and a second processor 480 coupled via a point-to-point interconnect450. In some embodiments, each of processors 470 and 480 may be someversion of processor 300 of FIG. 3.

Processors 470 and 480 are shown including integrated memory controller(IMC) units 472 and 482, respectively. Processor 470 also includes aspart of its bus controller units point-to-point (P-P) interfaces 476 and478; similarly, second processor 480 includes P-P interfaces 486 and488. Processors 470, 480 may exchange information via a point-to-point(P-P) interface 450 using P-P interface circuits 478, 488. As shown inFIG. 4, IMCs 472 and 482 couple the processors to respective memories,namely a memory 432 and a memory 434, which may be portions of mainmemory locally attached to the respective processors.

Processors 470, 480 may each exchange information with a chipset 490 viaindividual P-P interfaces 452, 454 using point to point interfacecircuits 476, 494, 486, 498. Chipset 490 may optionally exchangeinformation with the coprocessor 438 via a high-performance interface439. In one embodiment, the coprocessor 438 is a special-purposeprocessor, such as, for example, a high-throughput MIC processor, anetwork or communication processor, compression engine, graphicsprocessor, GPGPU, embedded processor, matrix processor, or the like.

A shared cache (not shown) may be included in either processor oroutside of both processors, yet connected with the processors via P-Pinterconnect, such that either or both processors' local cacheinformation may be stored in the shared cache if a processor is placedinto a low power mode.

Chipset 490 may be coupled to a first bus 416 via an interface 496. Inone embodiment, first bus 416 may be a Peripheral Component Interconnect(PCI) bus, or a bus such as a PCI Express bus or another thirdgeneration I/O interconnect bus, although the scope of this disclosureis not so limited.

As shown in FIG. 4, various I/O devices 414 may be coupled to first bus416, along with a bus bridge 418 which couples first bus 416 to a secondbus 420. In one embodiment, one or more additional processor(s) 415,such as coprocessors, high-throughput MIC processors, GPGPU's,accelerators (such as, e.g., graphics accelerators or digital signalprocessing (DSP) units), matrix processors, field programmable gatearrays, or any other processor, are coupled to first bus 416. In oneembodiment, second bus 420 may be a low pin count (LPC) bus. Variousdevices may be coupled to a second bus 420 including, for example, akeyboard and/or mouse 422, communication devices 427 and a storage unit428 such as a disk drive or other mass storage device which may includeinstructions/code and data 430, in one embodiment. Further, an audio I/O424 may be coupled to the second bus 420. Note that other architecturesare possible. For example, instead of the point-to-point architecture ofFIG. 4, a system may implement a multi-drop bus or other sucharchitecture.

All or part of any component of FIG. 4 may be implemented as a separateor stand-alone component or chip, or may be integrated with othercomponents or chips, such as a system-on-a-chip (SoC) that integratesvarious computer components into a single chip.

Embodiments of the mechanisms disclosed herein may be implemented inhardware, software, firmware, or a combination of such implementationapproaches. Certain embodiments may be implemented as computer programsor program code executing on programmable systems comprising at leastone processor, a storage system (including volatile and non-volatilememory and/or storage elements), at least one input device, and at leastone output device.

Program code, such as code 430 illustrated in FIG. 4, may be applied toinput instructions to perform the functions described herein andgenerate output information. The output information may be applied toone or more output devices, in known fashion. For purposes of thisapplication, a processing system includes any system that has aprocessor, such as, for example; a digital signal processor (DSP), amicrocontroller, an application specific integrated circuit (ASIC), or amicroprocessor.

The program code may be implemented in a high level procedural or objectoriented programming language to communicate with a processing system.The program code may also be implemented in assembly or machinelanguage, if desired. In fact, the mechanisms described herein are notlimited in scope to any particular programming language. In any case,the language may be a compiled or interpreted language.

One or more aspects of at least one embodiment may be implemented byrepresentative instructions stored on a machine-readable medium whichrepresents various logic within the processor, which when read by amachine causes the machine to fabricate logic to perform the techniquesdescribed herein. Such representations, known as “IP cores” may bestored on a tangible, machine readable medium and supplied to variouscustomers or manufacturing facilities to load into the fabricationmachines that actually make the logic or processor.

Such machine-readable storage media may include, without limitation,non-transitory, tangible arrangements of articles manufactured or formedby a machine or device, including storage media such as hard disks, anyother type of disk including floppy disks, optical disks, compact diskread-only memories (CD-ROMs), compact disk rewritable's (CD-RWs), andmagneto-optical disks, semiconductor devices such as read-only memories(ROMs), random access memories (RAMs) such as dynamic random accessmemories (DRAMs), static random access memories (SRAMs), erasableprogrammable read-only memories (EPROMs), flash memories, electricallyerasable programmable read-only memories (EEPROMs), phase change memory(PCM), magnetic or optical cards, or any other type of media suitablefor storing electronic instructions.

Accordingly, embodiments of this disclosure also include non-transitory,tangible machine-readable media containing instructions or containingdesign data, such as Hardware Description Language (HDL), which definesstructures, circuits, apparatuses, processors and/or system featuresdescribed herein. Such embodiments may also be referred to as programproducts.

Winograd Algorithm on a Matrix Processing Architecture

FIG. 5 illustrates an example embodiment of a matrix processing engine500. In some embodiments, matrix processing engine 500 may beimplemented by a matrix processing architecture, such as the matrixprocessing architecture of FIGS. 2A-2C. For example, in someembodiments, matrix processing engine 500 may be implemented by a matrixprocessing cluster on a matrix processing chip (e.g., matrix processingclusters 230 of matrix processing chip 220 from FIGS. 2B and 2C). Inthose embodiments, a particular matrix processing cluster may use itsassociated matrix processing engine 500 to perform matrix-basedprocessing and operations, such as partial matrix operations associatedwith a particular matrix operation distributed across multiple matrixprocessing resources (e.g., as described throughout this disclosure).

In some embodiments, matrix processing engine 500 may perform matrixmultiplication operations using an implementation of the Winograd matrixmultiplication algorithm. Winograd is an algorithm that acceleratesmatrix multiplication by transforming the operands of the matrixmultiplication operation into new “Winograd” operands that, whenmultiplied, require fewer overall multiplications by replacing some ofthe multiplications with addition and subtraction. The result of themultiplication on the Winograd operands, however, must then betransformed to obtain the final result of the original matrixmultiplication operation.

Winograd is particularly beneficial for small filter sizes and issuperior to other transform techniques like Fast Fourier Transform forthose small filter sizes. Matrix processing engine 500, for example, mayapply the Winograd algorithm to a 3×3 filter size, which is a commonfilter size in deep learning neural networks.

The performance improvement provided by the Winograd algorithm dependson the size of the output tile. For example, a Winograd algorithm can beimplemented to output either a 2×2 output tile, or a 4×4 output tile. AWinograd algorithm that outputs a 2×2 output tile can be referred to asWinograd 2, while a Winograd algorithm that outputs a 4×4 output tilecan be referred to as Winograd 4. For Winograd 2 (e.g., using a 2×2output tile), the Winograd transform converts the 3×3 filter into a 4×4filter with a stride of 2. The performance improvement provided byWinograd 2 using the 2×2 output tile is 2.25. For Winograd 4 (e.g.,using a 4×4 output tile), the Winograd transform converts the 3×3 filterinto a 6×6 filter with a stride of 4. The performance improvementprovided by Winograd 4 using the 4×4 output tile is 4. Accordingly,assuming the Winograd transforms are implemented efficiently, using theWinograd algorithm for a convolution operation can reduce the processingtime of a normal convolution by approximately one-half to one-fourth(depending on whether Winograd 2 or Winograd 4 is used). The illustratedarchitecture can be used to efficiently implement the Winograd algorithmto achieve the maximum performance improvement that is possible usingthe Winograd algorithm, which cannot be done using CPUs or GPUs.

In the illustrated embodiment, matrix processing engine 500 includesread engine 535, slice engine 536, and output engine 537, which arediscussed further below. The illustrated embodiment also depicts variouscomponents of the underlying matrix processing architecture that may beinvolved when performing matrix operations using matrix processingengine 500. For example, the illustrated embodiment depicts highbandwidth memory (HBM) modules 540, master control CPU (MCC) 532, matrixprocessing units (MPUs) 534, and memory resource blocks (MRBs) 538. Inthe illustrated embodiment, for example, these various components aresuperimposed on matrix processing engine 500 to illustrate how and whenthey would be used by matrix processing engine 500, as described furtherbelow.

HBM modules 540 may be high bandwidth memory (HBM) modules designed toefficiently store and retrieve large volumes of matrix data. In someembodiments, for example, HBM modules 540 may be high bandwidth memory(HBM) modules on a matrix processing chip (e.g., HBM modules 240 ofmatrix processing chip 220 from FIG. 2B).

MCC 532 may be a master control CPU (MCC) used to control and/or managematrix operations. In some embodiments, for example, MCC 532 may be themaster control CPU on a particular matrix processing cluster (e.g., MCC232 of matrix processing cluster 230 from FIG. 2C). In thoseembodiments, for example, MCC 532 may be used to control and/or managematrix operations performed on its particular cluster.

MPUs 534 may be matrix processing units (MPUs) used to perform matrixoperations. In some embodiments, for example, MPUs 534 may be matrixprocessing units on a particular matrix processing cluster (e.g., MPUs234 of matrix processing cluster 230 from FIG. 2C). For example, in someembodiments, a matrix processing cluster may include multiple matrixprocessing units (MPUs) for performing matrix operations. Theillustrated embodiment, for example, depicts two matrix processing units(MPUs) 534 a and 534 b. In some embodiments, MPUs 534 may perform matrixoperations based on commands or instructions from master control CPU(MCC) 532.

Memory resource blocks (MRBs) 538 may be memory components designed toefficiently store and retrieve matrix data. In some embodiments, forexample, MRBs 538 may be memory resource blocks on a particular matrixprocessing cluster (e.g., memory resource blocks 238 of matrixprocessing cluster 230 from FIG. 2C). In those embodiments, for example,MRBs 538 may be used to store and retrieve matrix data associated withmatrix operations performed on the particular cluster.

In the illustrated embodiment, matrix processing engine 500 isperforming matrix multiplication using an implementation of the Winogradmatrix multiplication algorithm. The illustrated implementation of theWinograd algorithm is implemented by matrix processing engine 500 usingread engine 535, slice engine 536, output engine 537, and transformengine 531, as described further below. Moreover, in the illustratedexample, matrix processing engine 500 is performing multiple matrixmultiplication operations in parallel. For example, as noted above,matrix processing engine 500 can be implemented on a particular matrixprocessing cluster, and the particular matrix processing cluster mayinclude multiple MPUs 534. In the illustrated example, matrix processingengine 500 is implemented on a cluster with two MPUs 534 a-b.Accordingly, matrix processing engine 500 can perform two matrixmultiplication operations in parallel using the respective MPUs 534.

The control flow for the particular implementation of the Winogradalgorithm begins with the read engine 535 of matrix processing engine500. Read engine 535 may first retrieve matrix data associated with aparticular matrix operation from an HBM module 540. In the illustratedexample, matrix processing engine 500 is being used to performconvolution operations, and thus the matrix data is associated with theimage(s) and filters involved in the convolution operations. In someembodiments, for example, the convolution operations may be associatedwith artificial intelligence functionality implemented using operationsin an artificial neural network, such as forward propagation, backwardpropagation, and/or weight update operations.

Read engine 535 may then store the matrix data retrieved from HBM 540 incertain MRBs 538 a of its associated cluster. In some embodiments, forexample, read engine 535 may use two MRBs 538 a to store the associatedmatrix data. For example, read engine 535 may use one MRB to storematrix data associated with an image, and may use another MRB to storematrix data associated with filters used for convolution operations onthat image. In some embodiments, read engine 535 may use the mastercontrol CPU (MCC) 532 on its respective cluster for storing andretrieving data on HBM 540 and MRBs 538.

Slice engine 536 may then “slice” the matrix data stored in MRBs 538 ato extract the particular matrix operands associated with theconvolution operations. For example, in some cases, the associatedmatrix operands may only be a subset of the matrix data stored in MRBs538 a, and/or the matrix operands may not be arranged contiguously inthe matrix data stored in MRBs 538 a. Accordingly, slice engine 536 mayextract particular “slices” or pieces of the matrix data stored in MRBs538 a, and may then arrange the slices in a particular manner to formthe respective matrix operands.

In the illustrated embodiment, slice engine 536 extracts a sliced matrixoperand and two filters from MRBs 538 a. For example, as noted above,MRBs 538 a may include two MRBs that are respectively used to storeimage data and filter data. The image data stored in one of the MRBs 538a may be used by slice engine 536 to extract a sliced matrix operand.The sliced matrix operand, for example, may be a particular portion ofthe image data involved in the convolution operations. The filter datastored in the other MRB 538 a can include two filters that areinterleaved. Interleaving filters in this manner allows two filters tobe stored in a single MRB 538 a, while also allowing those filters to beextracted simultaneously by slicing engine 536. Storing the filters in asingle MRB rather than two separate MRBs allows an MRB that wouldotherwise be needed to store one of the filters to be used for otherpurposes, resulting in more efficient use of valuable MRB memory.Moreover, interleaving the filters allows them to be simultaneouslyextracted by slice engine 536, thus avoiding any performance hit thatwould result from retrieving the filters separately.

The sliced operand and the two filters, for example, may be the operandsfor two separate matrix multiplication operations that are used tomultiply the sliced operand with each filter. However, because matrixprocessing engine 500 uses the Winograd algorithm for matrixmultiplication, slice engine 536 performs a Winograd transform on thesliced matrix operand in order to generate a transformed matrix operandfor the Winograd algorithm. An example of the Winograd transformperformed by slice engine 536 is described below in connection with FIG.6A. Slice engine 536 then stores the transformed Winograd operand andeach filter in respective MRBs. In the illustrated example, the Winogradoperand is stored in MRB 538 b, and the filters are respectively storedin MRB 538 c and MRB 538 d.

Output engine 537 may then perform matrix multiplication using thetransformed Winograd operand created by slice engine 536. For example,output engine 537 may perform separate matrix multiplication operationsto multiply the Winograd operand with each filter. Moreover, outputengine 537 can use different MPUs 534 a and 534 b to multiply therespective filters in parallel. Thus, the Winograd operand stored in MRB538 b is used in both matrix multiplication operations, and thus thatoperand may be broadcasted to both of the MPUs 534 a and 534 b.

In some embodiments, output engine 537 may first identify an associatedmatrix routine corresponding to the particular matrix operation, andoutput engine 537 may then obtain that matrix routine from matrixroutine memory 539. Matrix routine memory 539, for example, may be amemory component used to store matrix routines that are used by outputengine 537. A matrix routine, for example, may be a programmable routinefor a matrix processor that is designed to perform a particular matrixoperation when executed by the matrix processor. For example, a matrixroutine may include a series of instructions and/or commands, supportedby a particular matrix processor, and designed to perform a desiredmatrix operation when executed by the matrix processor. In someembodiments, for example, a matrix processor may be designed to supporta set of instructions and/or commands for performing various fundamentaloperations. For example, in some embodiments, a matrix processor maysupport instructions for processing data, performing various arithmeticoperations, and/or identifying matrix operands and outputs for thevarious instructions and operations. In this manner, the fundamentalinstructions and/or commands supported by the matrix processor can beused to program matrix routines for more complex matrix operations, suchas distributed matrix multiplication and/or convolution operations,dimension shuffle operations, reshape operations, and so forth.

After retrieving the appropriate matrix routine, output engine 537 maythen specify or supply certain information or fields used by the matrixroutine, if appropriate. For example, in some embodiments, certaininformation and/or fields of a matrix routine may be incomplete orunspecified, such as the size and/or location of the particular operandsfor the matrix routine. In some embodiments, output engine 537 may usethe master control CPU (MCC) 532 on its respective cluster to retrievematrix routines from matrix routine memory 539, and to specify or supplyany remaining information and/or fields for the particular matrixroutine (e.g., the size and/or location of matrix operands).

Output engine 537 may then execute the particular matrix routine. Inthis example, the matrix routine would be used to perform matrixmultiplication on the Winograd operand and each filter. For example, inthe illustrated embodiment, output engine 537 uses MPU 534 a to multiplythe Winograd operand 538 b with the first filter 538 c, and outputengine 537 uses MPU 534 b to multiply the Winograd operand 538 b withthe second filter 538 d. The result of each matrix multiplication usingthe Winograd operand is an output that is in “pre-transform” Winogradform and thus needs to be transformed into the final result of thematrix multiplication operation. For example, multiplying the Winogradoperand with the first filter (e.g., using MPU 534 a) results in anoutput in Winograd form that is stored in MRB 538 e. Similarly,multiplying the Winograd operand with the second filter (e.g., using MPU534 b) results in a different Winograd output that is stored in MRB 538g. Accordingly, each Winograd output in MRB 538 e and MRB 538 f,respectively, must be transformed into the final result of theirrespective matrix multiplication operations.

Transform engine 531 is used to transform each Winograd output 538 e and538 g into the final result for their respective matrix multiplicationoperations. An example of the Winograd transform performed by transformengine 531 is described below in connection with FIG. 6B. In someembodiments, transform engine 531 includes a transform routine memory533. Transform routine memory 533 is similar to matrix routine memory539 of output engine 537, except the transform routines are implementedprimarily using read and write instructions to manipulate data stored inthe MRBs. In some embodiments, transform engine 531 may be programmed toperform any type of transform using the transform routine memory 533.After performing the Winograd output transform on each Winograd output538 e and 538 g, transform engine 531 may then store the final resultfor each matrix multiplication operation in MRB 538 f and MRB 538 h,respectively.

Output engine 537 may then perform any remaining processing and/ortransmitting of the final results 538 f and 538 h of the matrixmultiplications. For example, in some cases, output engine 537 mayprovide the final results 538 f and 538 h to other components of thematrix processing architecture. For example, in some cases, a matrixmultiplication operation may be a partial matrix operation associatedwith a larger matrix operation distributed across multiple processingresources, and thus the output of the matrix operation may be a partialresult associated with the larger distributed operation. Moreover, theoutput of a partial matrix operation may be needed by other processingresource(s) involved in the distributed matrix operation. Accordingly,output engine 537 may provide the output of the partial matrix operationto the appropriate resource, for example, for further processing and/orstorage. For example, output engine 537 may provide the final result ofeach operation 538 f and 538 h to another adjacent cluster. In theillustrated embodiment, the final result 538 f of the matrixmultiplication on the first filter is transmitted to cluster 230 a,while the final result 538 h of the matrix multiplication on the secondfilter is transmitted to cluster 230 b. Alternatively, the final results538 f and 538 h could be transmitted to a particular high bandwidthmemory (HBM) module. In some embodiments, output engine 537 may use themaster control CPU (MCC) 532 on its respective cluster in order toprovide the result of a particular operation to the appropriatedestination.

In this manner, matrix processing engine 500 may be used to performmatrix multiplication algorithms using the described implementation ofthe Winograd algorithm.

FIGS. 6A and 6B illustrate example Winograd transforms performed by amatrix processing engine. For example, in some embodiments, theillustrated transforms may be used in the Winograd algorithm implementedby matrix processing engine 500 of FIG. 5.

FIG. 6A illustrates an example Winograd input transform 600A. The inputtransform 600A is an operation used to convert an original matrixmultiplication operand 620 a into a transformed Winograd matrix operand610 a used by the Winograd algorithm. The original matrix operand 620 a,for example, may be an operand of the original matrix multiplicationoperation that is being performed using the Winograd algorithm. In someembodiments, the original matrix operand 620 a may be a matrix operandcontaining matrix data associated with an image. The transformedWinograd matrix operand 610 a is created from the original matrixoperand 620 a, and can then be used in the Winograd algorithm (e.g., asdescribed above in connection with FIG. 5). In the illustrated transform600A, the original matrix operand 620 a is converted into the Winogradmatrix operand 610 a using matrix multiplication. For example, matrixmultiplication is performed on the original matrix operand 620 a usingtwo transform matrices 630 a and 640 a, where the second transformmatrix 640 a is the transpose of the first transform matrix 630 a. Theparticular coefficients used in the transform matrices 630 a and 640 aare illustrated in FIG. 6A. The original matrix operand 620 a is firstmultiplied by the first transform matrix 630 a, and the result from thatoperation is then multiplied by the second transform matrix 640 a. Theresult from the second operation is the transformed Winograd matrixoperand 610 a used by the Winograd algorithm.

FIG. 6B illustrates an example Winograd output transform 600B. Theoutput transform 600B is an operation used to transform the intermediateWinograd output 620 b of the Winograd algorithm into the final result610 b of the original matrix multiplication operation that is beingperformed using the Winograd algorithm (e.g., as described above inconnection with FIG. 5). In the illustrated transform 600B, the Winogradoutput 620 b is transformed into the final result 610 b using matrixmultiplication. For example, matrix multiplication is performed on theWinograd output 620 b using two transform matrices 630 b and 640 b,where the second transform matrix 640 b is the transpose of the firsttransform matrix 630 b. The particular coefficients used in thetransform matrices 630 b and 640 b are illustrated in FIG. 6B. TheWinograd output 620 b is first multiplied by the first transform matrix630 b, and the result from that operation is then multiplied by thesecond transform matrix 640 b. The result from the second operation isthe final result 610 b of the original matrix multiplication operationthat is performed using the Winograd algorithm.

FIG. 7 illustrates a flowchart 700 for an example embodiment of matrixmultiplication using the Winograd algorithm. Flowchart 700 may beimplemented, in some embodiments, by components described throughoutthis disclosure (e.g., the matrix processing architecture of FIGS. 2A-Cand/or the matrix processing engine of FIG. 5).

The flowchart may begin at block 702 by receiving a command to perform amatrix multiplication operation. The matrix multiplication operation,for example, may be associated with a convolution operation. In someembodiments, matrix operations, such as matrix multiplication andconvolution, may be used to implement computer vision artificialintelligence and machine learning capabilities in an artificial neuralnetwork. For example, in some embodiments, the matrix operation of block702 may be associated with operations in an artificial neural network,such as forward propagation, backward propagation, and/or weight updateoperations.

The flowchart may then proceed to block 704 to obtain matrix data frommemory. The matrix data, for example, may be associated with one or morematrix operands of the matrix operation. In some embodiments, the matrixdata may be obtained from multi-dimensional memory. Multi-dimensionalmemory, for example, may be a memory component designed to efficientlystore and retrieve matrix data in multiple dimensions (e.g.,two-dimensions).

The flowchart may then proceed to block 706 to obtain matrix operandsfrom the matrix data. In some embodiments, for example, the matrixoperands may be obtained by slicing the matrix data to extract thematrix operands from the matrix data. For example, for a convolutionoperation, a sliced matrix operand and a filter may be extracted fromthe matrix data. Moreover, in some embodiments, multiple filters may beextracted from the matrix data for performing two parallel matrixmultiplication operations on the sliced matrix operand and each filter.In some embodiments, the multiple filters may be interleaved in a singlememory resource block to preserve memory resource blocks, while stillallowing the filters to be retrieved simultaneously.

The flowchart may then proceed to block 708 to perform a Winogradtransform on the sliced matrix operand (e.g., using the Winogradtransform described above in connection with FIG. 6A). The Winogradtransform, for example, may be used to transform the sliced matrixoperand into a Winograd operand used in the Winograd matrixmultiplication algorithm.

The flowchart may then proceed to block 710 to perform matrixmultiplication using the transformed Winograd operand. In someembodiments, two matrix multiplications may be performed in parallel byrespective MPUs. For example, the transformed Winograd operand may beseparately multiplied by two filters using two separate matrixmultiplication operations.

The flowchart may then proceed to block 712 to perform another Winogradtransform on the output or partial result from the matrix multiplicationoperation from block 710. For example, the result of a matrixmultiplication operation on the transformed Winograd operand is anoutput or partial result that is in “pre-transform” Winograd form, andthus needs to be transformed into the final result of the matrixmultiplication operation. Accordingly, a Winograd transform may be usedto transform the Winograd partial result to the final result of thematrix multiplication operation (e.g., using the Winograd transformdescribed above in connection with FIG. 6B).

At this point, the flowchart may be complete. In some embodiments,however, the flowchart may restart and/or certain blocks may berepeated. For example, in some embodiments, the flowchart may restart atblock 702 to continue receiving and processing commands to performmatrix operations.

The flowcharts and block diagrams in the FIGURES illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods and computer program products according to variousaspects of the present disclosure. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof code, which comprises one or more executable instructions forimplementing the specified logical function(s). It should also be notedthat, in some alternative implementations, the functions noted in theblock may occur out of the order noted in the figures. For example, twoblocks shown in succession may, in fact, be executed substantiallyconcurrently, or the blocks may sometimes be executed in the reverseorder or alternative orders, depending upon the functionality involved.It will also be noted that each block of the block diagrams and/orflowchart illustration, and combinations of blocks in the block diagramsand/or flowchart illustration, can be implemented by special purposehardware-based systems that perform the specified functions or acts, orcombinations of special purpose hardware and computer instructions.

The foregoing disclosure outlines features of several embodiments sothat those skilled in the art may better understand various aspects ofthe present disclosure. Those skilled in the art should appreciate thatthey may readily use the present disclosure as a basis for designing ormodifying other processes and structures for carrying out the samepurposes and/or achieving the same advantages of the embodimentsintroduced herein. Those skilled in the art should also realize thatsuch equivalent constructions do not depart from the spirit and scope ofthe present disclosure, and that they may make various changes,substitutions, and alterations herein without departing from the spiritand scope of the present disclosure.

All or part of any hardware element disclosed herein may readily beprovided in a system-on-a-chip (SoC), including a central processingunit (CPU) package. An SoC represents an integrated circuit (IC) thatintegrates components of a computer or other electronic system into asingle chip. The SoC may contain digital, analog, mixed-signal, andradio frequency functions, all of which may be provided on a single chipsubstrate. Other embodiments may include a multi-chip-module (MCM), witha plurality of chips located within a single electronic package andconfigured to interact closely with each other through the electronicpackage. In various other embodiments, the computing functionalitiesdisclosed herein may be implemented in one or more silicon cores inApplication Specific Integrated Circuits (ASICs), Field ProgrammableGate Arrays (FPGAs), and other semiconductor chips.

As used throughout this specification, the term “processor” or“microprocessor” should be understood to include not only a traditionalmicroprocessor (such as Intel's® industry-leading x86 and x64architectures), but also matrix processors, graphics processors, and anyASIC, FPGA, microcontroller, digital signal processor (DSP),programmable logic device, programmable logic array (PLA), microcode,instruction set, emulated or virtual machine processor, or any similar“Turing-complete” device, combination of devices, or logic elements(hardware or software) that permit the execution of instructions.

Note also that in certain embodiments, some of the components may beomitted or consolidated. In a general sense, the arrangements depictedin the figures should be understood as logical divisions, whereas aphysical architecture may include various permutations, combinations,and/or hybrids of these elements. It is imperative to note thatcountless possible design configurations can be used to achieve theoperational objectives outlined herein. Accordingly, the associatedinfrastructure has a myriad of substitute arrangements, design choices,device possibilities, hardware configurations, software implementations,and equipment options.

In a general sense, any suitably-configured processor can executeinstructions associated with data or microcode to achieve the operationsdetailed herein. Any processor disclosed herein could transform anelement or an article (for example, data) from one state or thing toanother state or thing. In another example, some activities outlinedherein may be implemented with fixed logic or programmable logic (forexample, software and/or computer instructions executed by a processor)and the elements identified herein could be some type of a programmableprocessor, programmable digital logic (for example, a field programmablegate array (FPGA), an erasable programmable read only memory (EPROM), anelectrically erasable programmable read only memory (EEPROM)), an ASICthat includes digital logic, software, code, electronic instructions,flash memory, optical disks, CD-ROMs, DVD ROMs, magnetic or opticalcards, other types of machine-readable mediums suitable for storingelectronic instructions, or any suitable combination thereof.

In operation, a storage may store information in any suitable type oftangible, non-transitory storage medium (for example, random accessmemory (RAM), read only memory (ROM), field programmable gate array(FPGA), erasable programmable read only memory (EPROM), electricallyerasable programmable ROM (EEPROM), or microcode), software, hardware(for example, processor instructions or microcode), or in any othersuitable component, device, element, or object where appropriate andbased on particular needs. Furthermore, the information being tracked,sent, received, or stored in a processor could be provided in anydatabase, register, table, cache, queue, control list, or storagestructure, based on particular needs and implementations, all of whichcould be referenced in any suitable timeframe. Any of the memory orstorage elements disclosed herein should be construed as beingencompassed within the broad terms ‘memory’ and ‘storage,’ asappropriate. A non-transitory storage medium herein is expresslyintended to include any non-transitory special-purpose or programmablehardware configured to provide the disclosed operations, or to cause aprocessor to perform the disclosed operations. A non-transitory storagemedium also expressly includes a processor having stored thereonhardware-coded instructions, and optionally microcode instructions orsequences encoded in hardware, firmware, or software.

Computer program logic implementing all or part of the functionalitydescribed herein is embodied in various forms, including, but in no waylimited to, hardware description language, a source code form, acomputer executable form, machine instructions or microcode,programmable hardware, and various intermediate forms (for example,forms generated by an HDL processor, assembler, compiler, linker, orlocator). In an example, source code includes a series of computerprogram instructions implemented in various programming languages, suchas an object code, an assembly language, or a high-level language suchas OpenCL, FORTRAN, C, C++, JAVA, or HTML for use with various operatingsystems or operating environments, or in hardware description languagessuch as Spice, Verilog, and VHDL. The source code may define and usevarious data structures and communication messages. The source code maybe in a computer executable form (e.g., via an interpreter), or thesource code may be converted (e.g., via a translator, assembler, orcompiler) into a computer executable form, or converted to anintermediate form such as byte code. Where appropriate, any of theforegoing may be used to build or describe appropriate discrete orintegrated circuits, whether sequential, combinatorial, state machines,or otherwise.

In one example, any number of electrical circuits of the FIGURES may beimplemented on a board of an associated electronic device. The board canbe a general circuit board that can hold various components of theinternal electronic system of the electronic device and, further,provide connectors for other peripherals. More specifically, the boardcan provide the electrical connections by which the other components ofthe system can communicate electrically. Any suitable processor andmemory can be suitably coupled to the board based on particularconfiguration needs, processing demands, and computing designs. Othercomponents such as external storage, additional sensors, controllers foraudio/video display, and peripheral devices may be attached to the boardas plug-in cards, via cables, or integrated into the board itself. Inanother example, the electrical circuits of the FIGURES may beimplemented as stand-alone modules (e.g., a device with associatedcomponents and circuitry configured to perform a specific application orfunction) or implemented as plug-in modules into application specifichardware of electronic devices.

Note that with the numerous examples provided herein, interaction may bedescribed in terms of two, three, four, or more electrical components.However, this has been done for purposes of clarity and example only. Itshould be appreciated that the system can be consolidated orreconfigured in any suitable manner. Along similar design alternatives,any of the illustrated components, modules, and elements of the FIGURESmay be combined in various possible configurations, all of which arewithin the broad scope of this specification. In certain cases, it maybe easier to describe one or more of the functionalities of a given setof flows by only referencing a limited number of electrical elements. Itshould be appreciated that the electrical circuits of the FIGURES andits teachings are readily scalable and can accommodate a large number ofcomponents, as well as more complicated/sophisticated arrangements andconfigurations. Accordingly, the examples provided should not limit thescope or inhibit the broad teachings of the electrical circuits aspotentially applied to a myriad of other architectures.

Numerous other changes, substitutions, variations, alterations, andmodifications may be ascertained to one skilled in the art and it isintended that the present disclosure encompass all such changes,substitutions, variations, alterations, and modifications as fallingwithin the scope of the appended claims.

Example Implementations

The following examples pertain to embodiments described throughout thisdisclosure.

One or more embodiments may include an apparatus, comprising: amulti-dimensional memory; and a plurality of processing elements toperform a matrix operation, wherein the plurality of processing elementscomprises one or more matrix processors, and wherein the matrixoperation comprises a matrix multiplication operation on a plurality ofmatrix operands; wherein the plurality of processing elements isconfigured to: receive matrix data from the multi-dimensional memory,wherein the matrix data is associated with the plurality of matrixoperands; extract the plurality of matrix operands from the matrix data,wherein the plurality of matrix operands comprises a first matrixoperand and a second matrix operand; perform a first transform on thefirst matrix operand to obtain a transformed matrix operand, whereinperforming matrix multiplication using the transformed matrix operand isfaster than performing matrix multiplication using the first matrixoperand; perform matrix multiplication on the transformed matrix operandto obtain a partial result; and perform a second transform on thepartial result to obtain a result of the matrix multiplicationoperation.

In one example embodiment of an apparatus, the first transform is aWinograd input transform.

In one example embodiment of an apparatus, the second transform is aWinograd output transform.

In one example embodiment of an apparatus, the apparatus furthercomprises a transform routine memory, wherein the transform routinememory comprises one or more transform routines associated with one ormore transform operations.

In one example embodiment of an apparatus, the plurality of processingelements is further configured to: receive a first transform routinefrom the transform routine memory, wherein the first transform routineis associated with the first transform; and perform the first transformby executing the first transform routine.

In one example embodiment of an apparatus, the plurality of processingelements is further configured to: receive a second transform routinefrom the transform routine memory, wherein the second transform routineis associated with the second transform; and perform the secondtransform by executing the second transform routine.

In one example embodiment of an apparatus, the matrix data is associatedwith an image and a filter for a convolution operation.

In one example embodiment of an apparatus, the matrix data is associatedwith a plurality of filters for a plurality of convolution operations onthe image.

In one example embodiment of an apparatus, the matrix data associatedwith the plurality of filters is interleaved in the multi-dimensionalmemory.

In one example embodiment of an apparatus, the plurality of processingelements is further configured to perform a plurality of matrixmultiplication operations using the matrix data associated with theimage and the matrix data associated with the plurality of filters,wherein the plurality of matrix multiplication operations multiply thematrix data associated with the image with the matrix data associatedwith each filter.

In one example embodiment of an apparatus, the plurality of processingelements is further configured to slice the matrix data to extract theplurality of matrix operands.

In one example embodiment of an apparatus, the matrix operation isassociated with a forward propagation operation in a neural network.

In one example embodiment of an apparatus, the matrix operation isassociated with a backward propagation operation in a neural network.

One or more embodiments may include a method, comprising: performing amatrix operation, wherein the matrix operation comprises a matrixmultiplication operation on a plurality of matrix operands, and whereinperforming the matrix operation comprises: receiving matrix data from amulti-dimensional memory, wherein the matrix data is associated with theplurality of matrix operands; extracting the plurality of matrixoperands from the matrix data, wherein the plurality of matrix operandscomprises a first matrix operand and a second matrix operand; performinga first transform on the first matrix operand to obtain a transformedmatrix operand, wherein performing matrix multiplication using thetransformed matrix operand is faster than performing matrixmultiplication using the first matrix operand; performing matrixmultiplication on the transformed matrix operand to obtain a partialresult; and performing a second transform on the partial result toobtain a result of the matrix multiplication operation.

In one example embodiment of a method: the first transform is a Winogradinput transform; and the second transform is a Winograd outputtransform.

In one example embodiment of a method, the method further comprises:receiving a first transform routine from a transform routine memory,wherein the first transform routine is associated with the firsttransform; performing the first transform by executing the firsttransform routine; receiving a second transform routine from thetransform routine memory, wherein the second transform routine isassociated with the second transform; and performing the secondtransform by executing the second transform routine.

In one example embodiment of a method: the matrix data is associatedwith an image and a plurality of filters for a plurality of convolutionoperations; and the matrix data associated with the plurality of filtersis interleaved in the multi-dimensional memory.

One or more embodiments may include a system, comprising: a plurality ofmemory elements, wherein the plurality of memory elements comprises amulti-dimensional memory; a plurality of processing elements to performa matrix operation, wherein the matrix operation comprises a matrixmultiplication operation on a plurality of matrix operands; wherein theplurality of processing elements comprises: a host processor; and one ormore matrix processing chips; wherein the plurality of processingelements is configured to: receive matrix data from themulti-dimensional memory, wherein the matrix data is associated with theplurality of matrix operands; extract the plurality of matrix operandsfrom the matrix data, wherein the plurality of matrix operands comprisesa first matrix operand and a second matrix operand; perform a firsttransform on the first matrix operand to obtain a transformed matrixoperand, wherein performing matrix multiplication using the transformedmatrix operand is faster than performing matrix multiplication using thefirst matrix operand; perform matrix multiplication on the transformedmatrix operand to obtain a partial result; and perform a secondtransform on the partial result to obtain a result of the matrixmultiplication operation.

In one example embodiment of a system, each matrix processing chipcomprises a plurality of matrix processing clusters.

In one example embodiment of a system, each matrix processing clustercomprises a plurality of matrix processing units.

In one example embodiment of a system, each matrix processing clustercomprises a plurality of memory resource blocks.

One or more embodiments may include at least one machine accessiblestorage medium having instructions stored thereon, the instructions,when executed on a machine, cause the machine to: perform a matrixoperation, wherein the matrix operation comprises a matrixmultiplication operation on a plurality of matrix operands, and whereinthe instructions that cause the machine to perform the matrix operationcause the machine to: receive matrix data from a multi-dimensionalmemory, wherein the matrix data is associated with the plurality ofmatrix operands; extract the plurality of matrix operands from thematrix data, wherein the plurality of matrix operands comprises a firstmatrix operand and a second matrix operand; perform a first transform onthe first matrix operand to obtain a transformed matrix operand, whereinperforming matrix multiplication using the transformed matrix operand isfaster than performing matrix multiplication using the first matrixoperand; perform matrix multiplication on the transformed matrix operandto obtain a partial result; and perform a second transform on thepartial result to obtain a result of the matrix multiplicationoperation.

In one example embodiment of a storage medium, the instructions furthercause the machine to: perform the first transform using a Winograd inputtransform; and perform the second transform using a Winograd outputtransform.

In one example embodiment of a storage medium, the instructions furthercause the machine to: receive a first transform routine from a transformroutine memory, wherein the first transform routine is associated withthe first transform; perform the first transform by executing the firsttransform routine; receive a second transform routine from the transformroutine memory, wherein the second transform routine is associated withthe second transform; and perform the second transform by executing thesecond transform routine.

In one example embodiment of a storage medium: the matrix data isassociated with an image and a plurality of filters for a plurality ofconvolution operations; and the matrix data associated with theplurality of filters is interleaved in the multi-dimensional memory.

One or more embodiments may include an apparatus comprising means toperform a method from any of the preceding examples.

One or more embodiments may include at least one machine accessiblestorage medium having instructions stored thereon, the instructions whenexecuted on a machine, cause the machine to perform a method or realizean apparatus from any of the preceding examples.

1. An apparatus, comprising: a multi-dimensional memory; and a pluralityof processing elements to perform a matrix operation, wherein theplurality of processing elements comprises one or more matrixprocessors, and wherein the matrix operation comprises a matrixmultiplication operation on a first plurality of matrix operands;wherein the plurality of processing elements is configured to: receivematrix data from the multi-dimensional memory, wherein the matrix datais associated with the first plurality of matrix operands; extract thefirst plurality of matrix operands from the matrix data; perform a firsttransform on one or more of the first plurality of matrix operands toobtain a second plurality of matrix operands, wherein performing matrixmultiplication on the second plurality of matrix operands is faster thanperforming matrix multiplication on the first plurality of matrixoperands; perform matrix multiplication on the second plurality ofmatrix operands to obtain a partial result; and perform a secondtransform on the partial result to obtain a result of the matrixmultiplication operation.
 2. The apparatus of claim 1, wherein the firsttransform is a Winograd input transform.
 3. The apparatus of claim 1,wherein the second transform is a Winograd output transform.
 4. Theapparatus of claim 1, further comprising a transform routine memory,wherein the transform routine memory comprises one or more transformroutines associated with one or more transform operations.
 5. Theapparatus of claim 4, wherein the plurality of processing elements isfurther configured to: receive a first transform routine from thetransform routine memory, wherein the first transform routine isassociated with the first transform; and perform the first transform byexecuting the first transform routine.
 6. The apparatus of claim 4,wherein the plurality of processing elements is further configured to:receive a second transform routine from the transform routine memory,wherein the second transform routine is associated with the secondtransform; and perform the second transform by executing the secondtransform routine.
 7. The apparatus of claim 1, wherein the matrix datais associated with an image and a filter for a convolution operation. 8.The apparatus of claim 7, wherein the matrix data is associated with aplurality of filters for a plurality of convolution operations on theimage.
 9. The apparatus of claim 8, wherein the matrix data associatedwith the plurality of filters is interleaved in the multi-dimensionalmemory.
 10. The apparatus of claim 8, wherein the plurality ofprocessing elements is further configured to perform a plurality ofmatrix multiplication operations using the matrix data associated withthe image and the matrix data associated with the plurality of filters,wherein the plurality of matrix multiplication operations multiply thematrix data associated with the image with the matrix data associatedwith each filter.
 11. The apparatus of claim 1, wherein the plurality ofprocessing elements is further configured to slice the matrix data toextract the plurality of matrix operands.
 12. The apparatus of claim 1,wherein the matrix operation is associated with a forward propagationoperation in a neural network.
 13. The apparatus of claim 1, wherein thematrix operation is associated with a backward propagation operation ina neural network.
 14. A method, comprising: performing a matrixoperation, wherein the matrix operation comprises a matrixmultiplication operation on a first plurality of matrix operands, andwherein performing the matrix operation comprises: receiving matrix datafrom a multi-dimensional memory, wherein the matrix data is associatedwith the first plurality of matrix operands; extracting the firstplurality of matrix operands from the matrix data; performing a firsttransform on one or more of the first plurality of matrix operands toobtain a second plurality of matrix operands, wherein performing matrixmultiplication on the second plurality of matrix operands is faster thanperforming matrix multiplication on the first plurality of matrixoperands; performing matrix multiplication on the second plurality ofmatrix operands to obtain a partial result; and performing a secondtransform on the partial result to obtain a result of the matrixmultiplication operation.
 15. The method of claim 14, wherein: the firsttransform is a Winograd input transform; and the second transform is aWinograd output transform.
 16. The method of claim 14, furthercomprising: receiving a first transform routine from a transform routinememory, wherein the first transform routine is associated with the firsttransform; performing the first transform by executing the firsttransform routine; receiving a second transform routine from thetransform routine memory, wherein the second transform routine isassociated with the second transform; and performing the secondtransform by executing the second transform routine.
 17. The method ofclaim 14, wherein: the matrix data is associated with an image and aplurality of filters for a plurality of convolution operations; and thematrix data associated with the plurality of filters is interleaved inthe multi-dimensional memory.
 18. A system, comprising: a plurality ofmemory elements, wherein the plurality of memory elements comprises amulti-dimensional memory; a plurality of processing elements to performa matrix operation, wherein the matrix operation comprises a matrixmultiplication operation on a first plurality of matrix operands;wherein the plurality of processing elements comprises: a hostprocessor; and one or more matrix processing chips; wherein theplurality of processing elements is configured to: receive matrix datafrom the multi-dimensional memory, wherein the matrix data is associatedwith the first plurality of matrix operands; extract the first pluralityof matrix operands from the matrix data; perform a first transform onone or more of the first plurality of matrix operands to obtain a secondplurality of matrix operands, wherein performing matrix multiplicationon the second plurality of matrix operands is faster than performingmatrix multiplication on the first plurality of matrix operands; performmatrix multiplication on the second plurality of matrix operands toobtain a partial result; and perform a second transform on the partialresult to obtain a result of the matrix multiplication operation. 19.The system of claim 18, wherein each matrix processing chip comprises aplurality of matrix processing clusters.
 20. The system of claim 19,wherein each matrix processing cluster comprises a plurality of matrixprocessing units.
 21. The system of claim 19, wherein each matrixprocessing cluster comprises a plurality of memory resource blocks. 22.At least one machine accessible storage medium having instructionsstored thereon, the instructions, when executed on a machine, cause themachine to: perform a matrix operation, wherein the matrix operationcomprises a matrix multiplication operation on a first plurality ofmatrix operands, and wherein the instructions that cause the machine toperform the matrix operation cause the machine to: receive matrix datafrom a multi-dimensional memory, wherein the matrix data is associatedwith the first plurality of matrix operands; extract the first pluralityof matrix operands from the matrix data; perform a first transform onone or more of the first plurality of matrix operands to obtain a secondplurality of matrix operands, wherein performing matrix multiplicationon the second plurality of matrix operands is faster than performingmatrix multiplication on the first plurality of matrix operands; performmatrix multiplication on the second plurality of matrix operands toobtain a partial result; and perform a second transform on the partialresult to obtain a result of the matrix multiplication operation. 23.The storage medium of claim 22, wherein the instructions further causethe machine to: perform the first transform using a Winograd inputtransform; and perform the second transform using a Winograd outputtransform.
 24. The storage medium of claim 22, wherein the instructionsfurther cause the machine to: receive a first transform routine from atransform routine memory, wherein the first transform routine isassociated with the first transform; perform the first transform byexecuting the first transform routine; receive a second transformroutine from the transform routine memory, wherein the second transformroutine is associated with the second transform; and perform the secondtransform by executing the second transform routine.
 25. The storagemedium of claim 22, wherein: the matrix data is associated with an imageand a plurality of filters for a plurality of convolution operations;and the matrix data associated with the plurality of filters isinterleaved in the multi-dimensional memory.